Repository navigation
Generate build metadata in SKERNEL - #2
Merged
Merged
Conversation
The generator reads composer.json, composer.lock, and Composer's installation state, locates the installed packages, applies their autoload rules, maps their classes with ext-tokenizer, and instantiates their attributes with each class's failure isolated. It publishes through the project's own super-kernel/metadata and annotator, after checking their build protocol. It lives in its own namespace, SKERNEL\Generator, because it runs in the project's process next to the project's own Src classes, and it depends on no package so that it can also build SKERNEL from source. generator/generate.php runs it in a child process: it reads a request file and writes one report, also when a class ends the process with a fatal error. The console test that asserts a long path now uses a wide terminal, so that Console does not break the path inside a word. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build now runs the generator with the project's PHP in the project directory, checks the build protocol of the project's super-kernel/metadata first, and reruns it without any class whose loading ends the process with a fatal error. A second fresh process boots the container from the generated records and publishes ApplicationBuild as before. After a successful build, the classes whose attributes could not be collected are listed on STDERR. A standalone SKERNEL extracts the generator to its home, keyed by the digest of its files, because another process cannot read the binary's PHAR. run builds before every start, and with --watch also before every restart; a failed rebuild waits for the next change. package builds its staged copy the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bin/bootstrap.php runs the generator in SKERNEL's own process before the container starts, so that SKERNEL restores its container from generated metadata like any SuperKernel application and no longer depends on scanning at start. A PHAR carries the artifacts of its build instead. SKERNEL's own skipped classes stay silent, because they say nothing a SKERNEL user can act on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Writing the version into composer.json changes the content hash that composer.lock records, so the install from the committed lock, and the one package runs on its staged copy, warned that the lock was not up to date. The release now refreshes only that hash; the locked packages stay as committed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A project installed with --no-dev, as package installs its staged copy, has no autoloader for its autoload-dev classes, so the build listed every attribute- bearing test class as skipped. The root's class map now includes autoload-dev only when Composer installed development dependencies, as Composer's own autoloader does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The annotator's AttributeMetadata serializes and restores each attribute, and the generator built it only while publishing, so one attribute that stores a closure failed every build. The scan now converts each class's attributes inside the class's own isolation, so such a class is skipped with a diagnostic and contributes nothing, as the scan before the generator did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every start from source regenerates SKERNEL's artifacts, and regenerating removes the previous stamp first, so a second start could remove it while the first was restoring its container. A start now holds an exclusive lock on vendor/.cache/skernel.lock from generating until its container has restored the artifacts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SKERNEL builds its own artifacts with super-kernel/metadata and super-kernel/annotator, so it requires them directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refresh the lock for the new requirements: super-kernel/metadata and the annotation publisher, with the restore-only container. The Composer metadata and tokenizer packages are no longer installed. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SKERNEL now generates a project's build metadata itself. A container-free generator, which runs inside the project's own PHP process, reads
composer.jsonandcomposer.lock, locates the installed packages, scans their class maps and attributes, and publishes the records throughsuper-kernel/metadataand the annotation publisher, so an application only restores them at start.build,run, andpackageuse it:buildchecks the build protocol first and names the side to upgrade, skips a class whose attributes cannot be collected or published and lists it on STDERR, and reruns after a fatal error with the failing class skipped. A standalone SKERNEL extracts the generator to its home directory; from source, SKERNEL generates its own artifacts before it starts, under a lock. A--no-devpackage no longer maps the root's development classes. The release refreshes the lock hash after it sets the version, which removes the out-of-date lock warning.Validation
composer validate --strict,composer test(162 tests), andcomposer format:checkpass with the locked packages. A project template built by the generator starts and passes its own tests, and a binary built from this source rebuilt SKERNEL itself.🤖 Generated with Claude Code